/*
 *  hexdump.c
 *
 *  Code from http://sws.dett.de/mini/hexdump-c/
 *
 *  David Lobato 2011 <dav.lobato@gmail.com>
 *
 *  This file is part of Surveyor SVS player/stage driver.
 *
 *  Surveyor SVS player/stage driver is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *   Surveyor SVS player/stage driver is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with Surveyor SVS player/stage driver.
 *   If not, see <http://www.gnu.org/licenses/>.
 *
 */

#ifndef SURVEYORSVS_HEXDUMP_H_
#define SURVEYORSVS_HEXDUMP_H_

#ifdef __cplusplus
extern "C"
{
#endif

#include <stdio.h>

/**
 * dumps size bytes of *data to stream.
 *
 * Looks like:
 * [0000] 75 6E 6B 6E 6F 77 6E 20   30 FF 00 00 00 00 39 00 unknown 0.....9.
 * \param stream the stream to write to
 * \param data the data to be dumped
 * \param offset if positive data will be dumped from data+offset to data+offset+(size-offset).
 * If negative from data+(size-abs(offset)) to data+(size-abs(offset))+abs(offset)
 */
void fhex_dump(FILE *stream, void *data, long offset, size_t size);

/* dumps size bytes of *data to stdout. Looks like:
 * [0000] 75 6E 6B 6E 6F 77 6E 20   30 FF 00 00 00 00 39 00 unknown 0.....9.
 */
void hex_dump(void *data, long offset, size_t size);

#ifdef __cplusplus
}
#endif

#endif /* SURVEYORSVS_HEXDUMP_H_ */

